package cn.smbms.pojo;

import java.util.ArrayList;
import java.util.List;

public class PageUtil<T> {
	private Integer pageSize = 10;// 页面大小

	private Integer totalPage;// 总页数

	private Integer currentPage;// 当前页数

	private Integer totalCount;// 总记录条数

	private List<T> rows = new ArrayList<T>();// 每页记录集合

	public Integer getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(Integer totalPage) {
		this.totalPage = totalPage;
	}

	public Integer getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(Integer currentPage) {
		this.currentPage = currentPage;
	}

	public Integer getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
		this.totalPage = (totalCount / pageSize) + (totalCount % pageSize == 0 ? 0 : 1);
	}

	public void setRows(List<T> rows) {
		this.rows = rows;
	}

	public List<T> getRows() {
		return rows;
	}

}
